* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #101010;
  border-top: 6px solid #f1d23a;
  background: fixed linear-gradient(transparent, #fff 70%),
    fixed
      repeating-linear-gradient(
        #efefef,
        #efefef 1px,
        transparent 1px,
        transparent 40px
      ),
    fixed
      repeating-linear-gradient(
        to right,
        #efefef,
        #efefef 1px,
        transparent 1px,
        transparent 40px
      )
      #fff;
  padding: 2rem 3rem;
  margin-inline: auto;
  max-inline-size: 1500px;

  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas:
    "header header header header"
    "main main main main"
    "sidebar sidebar sidebar sidebar"
    "footer footer footer footer";
  gap: 1rem;
  min-height: 100vh;
}

@media (width >= 650px) {
  body {
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "header header header header"
      "main main main sidebar"
      "footer footer footer footer";
  }
}

.site-header {
  grid-area: header;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 500;
}

.site-nav-toggle {
  font-size: 2rem;
  border: none;
  background-color: transparent;
  cursor: pointer;
}

.site-nav {
  justify-content: flex-end;
  gap: 1.25rem;
  display: none;
}

@media (width >= 650px) {
  .site-nav-toggle {
    display: none;
  }

  .site-nav {
    display: flex;
  }
}

.site-nav a {
  font-size: 1rem;
  font-weight: 500;
  color: #101010;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav-toggle:hover {
  color: #b89900;
}

.site-nav a:focus-visible,
.site-nav-toggle:focus-visible {
  color: #b89900;
  outline: 1px dotted #b89900;
  outline-offset: 0.25em;
}

.content {
  grid-area: main;
  padding: 1rem 1.5rem;
}

.sidebar {
  grid-area: sidebar;
  padding: 1rem 1.5rem;
}

.site-footer {
  grid-area: footer;
  padding: 1rem 1.5rem;
}

.site-header,
.site-footer,
.content,
.sidebar {
  background-color: #fbf4d6;
  border: 1px solid #e7d586;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.5;
  margin-block-end: 0.25em;
}

h2 {
  font-size: 1.15rem;
  line-height: 1.5;
  margin-block-end: 0.5em;
}

p:not(:last-child) {
  margin-block-end: 1em;
}

.thumbnail {
  aspect-ratio: 1 / 0.5;
  margin-block-end: 1rem;
  background-color: #ffe566;
}

/*
@media (width > 30rem) {
  .post-thumbnails {
    display: flex;
    gap: 1rem;
  }

  .thumbnail {
    flex: 1;
  }
}
*/

/* @container queries */

/*
  container-type: normal;
  container-type: size;
  container-type: inline-size;
*/

.content,
.sidebar {
  container-type: inline-size;
}

.content {
  /* container-name: content; */
  /* container-type: inline-size; */
  container: content / inline-size;
}

.sidebar {
  container: sidebar / inline-size;
}

/*
  cqw = Container query width
  cqh = Container query height
  cqi = Container query inline size
  cqb = Container query block size
  cqmin = Minimum of inline size or block size
  cqmax = Maximum of inline size or block size
*/

@container (width > 20rem) {
  .post-thumbnails {
    display: flex;
    gap: 1rem;
  }

  .thumbnail {
    flex: 1;
  }

  p {
    font-size: clamp(1rem, 1rem + 1.25cqw, 2rem);
  }
}

/* @container content (width > 20rem) { */
/* @container content (width > 20rem)  and (width < 35rem) { */
@container content (20rem < width < 35rem) {
  .post-thumbnails {
    --bg-color: darkkhaki;

    /* background-color: darkkhaki; */
    background-color: var(--bg-color);
    padding: 1rem;
  }

  .thumbnail {
    margin-block-end: 0;
  }
}

@container style(--bg-color: darkkhaki) {
  .thumbnail {
    border: 1px solid #000;
  }
}

@media (width > 45rem) {
  .sidebar {
    --bg-color: #dbf5e7;

    background-color: var(--bg-color);
    border: 1px solid #82d6a9;
  }
}

@container style(--bg-color: #dbf5e7) {
  @container (width < 30rem) {
    .thumbnail {
      background-color: #93ebbc;
    }
  }
}
